package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.Purchase;
import com.woniu.supermarket.vo.PurchaseVo;
import com.woniu.supermarket.vo.SearchPurchaseVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface PurchaseMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Purchase record);

    Purchase selectByPrimaryKey(Integer id);

    List<PurchaseVo> selectAllPurchase();

    int updateByPrimaryKey(Purchase record);

    int updateByPurchaseVo(PurchaseVo purchaseVo);

    int deleteBatchPurchase(int[] ids);

    List<PurchaseVo> selectByCons(@Param("searchPurchaseVo") SearchPurchaseVo searchPurchaseVo);

    int inertPurchaseOrder(PurchaseVo purchaseVo);

    Purchase selectPurchaseByPurchaseNumber(String purchaseNumber);

    PurchaseVo selectPurchaseAndDetailByPurchaseNumber(String purchaseNumber);

    int updateStatusByPurchaseNumber(@Param("purchaseNumber") String purchaseNumber,@Param("status") int status);

    List<PurchaseVo> selectAll();

}